

<!DOCTYPE html>
<html lang="zh-CN" data-default-color-scheme=auto>



<head>
  <meta charset="UTF-8">
  <link rel="apple-touch-icon" sizes="76x76" href="/img/favicon.png">
  <link rel="icon" href="/img/favicon.png">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  
  <meta name="theme-color" content="#2f4154">
  <meta name="author" content="Cheney">
  <meta name="keywords" content="Coding">
  
    <meta name="description" content="分别采用先来先服务、最短寻道优先以及电梯调度算法进行调度。求给出每种算法中磁盘访问的顺序，计算出平均移动道数。">
<meta property="og:type" content="article">
<meta property="og:title" content="磁盘调度算法（先来先服务、最短寻道优先以及电梯调度算法）">
<meta property="og:url" content="https://cheney822.gitee.io/2021/05/03/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F__%E7%A3%81%E7%9B%98%E8%B0%83%E5%BA%A6%E7%AE%97%E6%B3%95%EF%BC%88%E5%85%88%E6%9D%A5%E5%85%88%E6%9C%8D%E5%8A%A1%E3%80%81%E6%9C%80%E7%9F%AD%E5%AF%BB%E9%81%93%E4%BC%98%E5%85%88%E4%BB%A5%E5%8F%8A%E7%94%B5%E6%A2%AF%E8%B0%83%E5%BA%A6%E7%AE%97%E6%B3%95%EF%BC%89/index.html">
<meta property="og:site_name" content="Cheney blog">
<meta property="og:description" content="分别采用先来先服务、最短寻道优先以及电梯调度算法进行调度。求给出每种算法中磁盘访问的顺序，计算出平均移动道数。">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://img-blog.csdnimg.cn/992a49478a0a42869b872971a13fc151.gif">
<meta property="og:image" content="https://imgbed.cheney.cc/picgo/20210505225833777.png">
<meta property="article:published_time" content="2021-05-03T00:22:00.000Z">
<meta property="article:modified_time" content="2022-04-05T13:14:30.135Z">
<meta property="article:author" content="Cheney">
<meta property="article:tag" content="算法">
<meta property="article:tag" content="C语言">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="https://img-blog.csdnimg.cn/992a49478a0a42869b872971a13fc151.gif">
  
  
  <title>磁盘调度算法（先来先服务、最短寻道优先以及电梯调度算法） - Cheney blog</title>

  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4/dist/css/bootstrap.min.css" />


  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/github-markdown-css@4/github-markdown.min.css" />
  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/hint.css@2/hint.min.css" />

  
    
    
      
      <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/highlight.js@10/styles/github-gist.min.css" />
    
  

  
    <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3/dist/jquery.fancybox.min.css" />
  


<!-- 主题依赖的图标库，不要自行修改 -->

<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_ba1fz6golrf.css">



<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_lbnruvf0jn.css">


<link  rel="stylesheet" href="/css/main.css" />

<!-- 自定义样式保持在最底部 -->


  <script id="fluid-configs">
    var Fluid = window.Fluid || {};
    var CONFIG = {"hostname":"cheney822.gitee.io","root":"/","version":"1.8.14","typing":{"enable":true,"typeSpeed":70,"cursorChar":"_","loop":false},"anchorjs":{"enable":true,"element":"h1,h2,h3,h4,h5,h6","placement":"right","visible":"hover","icon":""},"progressbar":{"enable":true,"height_px":3,"color":"#29d","options":{"showSpinner":false,"trickleSpeed":100}},"copy_btn":true,"image_zoom":{"enable":true,"img_url_replace":["",""]},"toc":{"enable":true,"headingSelector":"h1,h2,h3,h4,h5,h6","collapseDepth":1},"lazyload":{"enable":true,"loading_img":"/img/loading.gif","onlypost":false,"offset_factor":2},"web_analytics":{"enable":false,"baidu":null,"google":null,"gtag":null,"tencent":{"sid":null,"cid":null},"woyaola":null,"cnzz":null,"leancloud":{"app_id":null,"app_key":null,"server_url":null,"path":"window.location.pathname","ignore_local":false}},"search_path":"/local-search.xml"};
  </script>
  <script  src="/js/utils.js" ></script>
  <script  src="/js/color-schema.js" ></script>
<meta name="generator" content="Hexo 5.4.1"></head>


<body>
  <header style="height: 70vh;">
    <nav id="navbar" class="navbar fixed-top  navbar-expand-lg navbar-dark scrolling-navbar">
  <div class="container">
    <a class="navbar-brand" href="/">
      <strong>Cheney Blog</strong>
    </a>

    <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
            data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <div class="animated-icon"><span></span><span></span><span></span></div>
    </button>

    <!-- Collapsible content -->
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav ml-auto text-center">
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/">
                <i class="iconfont icon-home-fill"></i>
                首页
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/archives/">
                <i class="iconfont icon-archive-fill"></i>
                归档
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/categories/">
                <i class="iconfont icon-category-fill"></i>
                分类
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/tags/">
                <i class="iconfont icon-tags-fill"></i>
                标签
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/about/">
                <i class="iconfont icon-user-fill"></i>
                关于
              </a>
            </li>
          
        
        
          <li class="nav-item" id="search-btn">
            <a class="nav-link" target="_self" href="javascript:;" data-toggle="modal" data-target="#modalSearch" aria-label="Search">
              &nbsp;<i class="iconfont icon-search"></i>&nbsp;
            </a>
          </li>
        
        
          <li class="nav-item" id="color-toggle-btn">
            <a class="nav-link" target="_self" href="javascript:;" aria-label="Color Toggle">&nbsp;<i
                class="iconfont icon-dark" id="color-toggle-icon"></i>&nbsp;</a>
          </li>
        
      </ul>
    </div>
  </div>
</nav>

    <div class="banner" id="banner" parallax=true
         style="background: url('https://imgbed.cheney.cc/Blog_config/default.png') no-repeat center center;
           background-size: cover;">
      <div class="full-bg-img">
        <div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
          <div class="page-header text-center fade-in-up">
            <span class="h2" id="subtitle" title="磁盘调度算法（先来先服务、最短寻道优先以及电梯调度算法）">
              
            </span>

            
              <div class="mt-3">
  
  
    <span class="post-meta">
      <i class="iconfont icon-date-fill" aria-hidden="true"></i>
      <time datetime="2021-05-03 08:22" pubdate>
        2021年5月3日 早上
      </time>
    </span>
  
</div>

<div class="mt-1">
  
    <span class="post-meta mr-2">
      <i class="iconfont icon-chart"></i>
      2.9k 字
    </span>
  

  
    <span class="post-meta mr-2">
      <i class="iconfont icon-clock-fill"></i>
      
      
      15 分钟
    </span>
  

  
  
</div>

            
          </div>

          
        </div>
      </div>
    </div>
  </header>

  <main>
    
      

<div class="container-fluid nopadding-x">
  <div class="row nomargin-x">
    <div class="d-none d-lg-block col-lg-2"></div>
    <div class="col-lg-8 nopadding-x-md">
      <div class="container nopadding-x-md" id="board-ctn">
        <div class="py-5" id="board">
          <article class="post-content mx-auto">
            <!-- SEO header -->
            <h1 style="display: none">磁盘调度算法（先来先服务、最短寻道优先以及电梯调度算法）</h1>
            
            <div class="markdown-body">
              <h2 id="背景：磁盘调度"><a href="#背景：磁盘调度" class="headerlink" title="背景：磁盘调度"></a>背景：磁盘调度</h2><h2 id="题目描述"><a href="#题目描述" class="headerlink" title="题目描述"></a>题目描述</h2><ul>
<li>1、对于如下给定的一组磁盘访问进行调度：<br>请求服务到达 A B C D E F G H I J K L M N<br>访问的磁道号 30 50 100 180 20 90 150 70 80 10 160 120 40 110</li>
</ul>
<p>| 请求服务到达 | A |B  |  C | D  |E   |F   |G   |H   | I  |  J |  K | L  | M  |  N |<br>|–|–|–|–|–|–|–|–|–|–|–|–|–|–|–|–|–|–|–|–|–|–|–|–|–|–|–|–|–|–|–|–|–|–|–|–|–|–|<br>|访问的磁道号  |30   |50  |100   | 180  | 20  |  90 |  150 | 70  | 80 | 10  | 160  |  120 | 40  |  110 |</p>
<ul>
<li>2、要求分别采用先来先服务、最短寻道优先以及电梯调度算法进行调度。</li>
<li>3、要求给出每种算法中磁盘访问的顺序，计算出平均移动道数。</li>
<li>4、假定当前读写头在90号，电梯调度算法向磁道号增加的方向移动。</li>
</ul>
<h2 id="算法设计"><a href="#算法设计" class="headerlink" title="算法设计"></a>算法设计</h2><h3 id="先来先服务算法（FCFS）"><a href="#先来先服务算法（FCFS）" class="headerlink" title="先来先服务算法（FCFS）:"></a>先来先服务算法（FCFS）:</h3><p>按访问请求到达的先后次序服务。</p>
<h3 id="最短寻道时间优先算法（SSTF）"><a href="#最短寻道时间优先算法（SSTF）" class="headerlink" title="最短寻道时间优先算法（SSTF）:"></a>最短寻道时间优先算法（SSTF）:</h3><p>优先选择距当前磁头最近的访问请求进行服务</p>
<h3 id="扫描算法（电梯算法）（SCAN）"><a href="#扫描算法（电梯算法）（SCAN）" class="headerlink" title="扫描算法（电梯算法）（SCAN）:"></a>扫描算法（电梯算法）（SCAN）:</h3><p>当有访问请求时，磁头按一个方向移动，在移动过程中对遇到的访问请求进行服务，然后判断该方向上是否还有访问请求，如果有则继续扫描；否则改变移动方向，并为经过的访问请求服务，如此反复。</p>
<h2 id="代码实现"><a href="#代码实现" class="headerlink" title="代码实现"></a>代码实现</h2><center> <img src="https://img-blog.csdnimg.cn/992a49478a0a42869b872971a13fc151.gif" srcset="/img/loading.gif" lazyload width="60%">
<center><b><font size ='3'>感谢支持</font></b></center></font>

<figure class="highlight cpp"><table><tr><td class="gutter"><div class="code-wrapper"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br></pre></div></td><td class="code"><pre><code class="hljs cpp"><span class="hljs-meta">#<span class="hljs-keyword">include</span> <span class="hljs-string">&lt;iostream&gt;</span></span><br><span class="hljs-meta">#<span class="hljs-keyword">include</span> <span class="hljs-string">&lt;queue&gt;</span></span><br><span class="hljs-meta">#<span class="hljs-keyword">include</span> <span class="hljs-string">&lt;cmath&gt;</span></span><br><span class="hljs-keyword">using</span> <span class="hljs-keyword">namespace</span> std;<br><br><span class="hljs-type">int</span> request[]&#123;<span class="hljs-number">30</span>,<span class="hljs-number">50</span>,<span class="hljs-number">100</span>,<span class="hljs-number">180</span>,<span class="hljs-number">20</span>,<span class="hljs-number">90</span>,<span class="hljs-number">150</span>,<span class="hljs-number">70</span>,<span class="hljs-number">80</span>,<span class="hljs-number">10</span>,<span class="hljs-number">160</span>,<span class="hljs-number">120</span>,<span class="hljs-number">40</span>,<span class="hljs-number">110</span>&#125;;<br><span class="hljs-type">const</span> <span class="hljs-type">int</span> n = <span class="hljs-number">14</span>;<br>queue&lt;<span class="hljs-type">int</span>&gt; FCFS_order, SSTF_order, SCAN_order;<br><span class="hljs-comment">//queue&lt;int&gt; FCFS_move, SSTF_move, SCAN_move;</span><br><span class="hljs-type">int</span> FCFS_num = <span class="hljs-number">0</span>, SSTF_num = <span class="hljs-number">0</span>, SCAN_num = <span class="hljs-number">0</span>;<br><span class="hljs-type">int</span> beg_loc = <span class="hljs-number">90</span>;<span class="hljs-comment">//前读写头在90号</span><br><span class="hljs-type">char</span> beg_direct = <span class="hljs-string">&#x27;+&#x27;</span>;<span class="hljs-comment">//电梯调度算法向磁道号增加的方向移动。</span><br><br><br><span class="hljs-function"><span class="hljs-type">void</span> <span class="hljs-title">C_FCFS</span><span class="hljs-params">()</span> </span>&#123;<br>    <span class="hljs-type">int</span> loc = beg_loc;<br>    <span class="hljs-keyword">for</span> (<span class="hljs-type">int</span> i = <span class="hljs-number">0</span>; i &lt; n; i++) &#123;<br>        <span class="hljs-type">int</span> tem = request[i];<br>        FCFS_order.<span class="hljs-built_in">push</span>(tem);<br>       <span class="hljs-comment">// FCFS_move.push(abs(loc - tem));</span><br>        FCFS_num += <span class="hljs-built_in">abs</span>(loc - tem);<br>        loc = tem;<br>    &#125;<br>&#125;<br><span class="hljs-function"><span class="hljs-type">void</span> <span class="hljs-title">C_SSTF</span><span class="hljs-params">()</span> </span>&#123;<br>    <span class="hljs-type">int</span> t[n];<br>    <span class="hljs-keyword">for</span> (<span class="hljs-type">int</span> i = <span class="hljs-number">0</span>; i &lt; n; i++)<br>        t[i] = request[i];<br>    <span class="hljs-built_in">sort</span>(t, t + n);<span class="hljs-comment">//排序</span><br>    <span class="hljs-type">int</span> loc = beg_loc;<br>    <span class="hljs-type">int</span> pre_loc = beg_loc;<br>    <span class="hljs-keyword">for</span> (<span class="hljs-type">int</span> j = <span class="hljs-number">0</span>; j &lt; n; j++)&#123;<br>        <span class="hljs-type">int</span> min_dis = <span class="hljs-number">9999</span>;<br>        <span class="hljs-type">int</span> tem = <span class="hljs-number">0</span>;<br>        <span class="hljs-keyword">for</span> (<span class="hljs-type">int</span> i = <span class="hljs-number">0</span>; i &lt; n; i++)&#123;<br>            <span class="hljs-keyword">if</span> (<span class="hljs-built_in">abs</span>(t[i] - loc) &lt; min_dis)<br>                min_dis = <span class="hljs-built_in">abs</span>(t[i] - loc), tem = i;<br>        &#125;<br>        loc = t[tem];<br>        SSTF_order.<span class="hljs-built_in">push</span>(loc);<br>        SSTF_num += <span class="hljs-built_in">abs</span>(t[tem] - pre_loc);<br>        pre_loc = loc;<br>        t[tem] = <span class="hljs-number">99999</span>;<br>    &#125;<br>&#125;<br><span class="hljs-function"><span class="hljs-type">void</span> <span class="hljs-title">C_SCAN</span><span class="hljs-params">()</span> </span>&#123;<br>    <span class="hljs-type">int</span> t[n];<br>    <span class="hljs-keyword">for</span> (<span class="hljs-type">int</span> i = <span class="hljs-number">0</span>; i &lt; n; i++)<br>        t[i]= request[i];<br>    <span class="hljs-built_in">sort</span>(t,t+n);<span class="hljs-comment">//排序</span><br>    <span class="hljs-type">int</span> loc = <span class="hljs-number">0</span>;<br>    <span class="hljs-keyword">for</span> (<span class="hljs-type">int</span> i = <span class="hljs-number">0</span>; i &lt; n; i++) <br>        <span class="hljs-keyword">if</span> (t[i] &gt;= beg_loc) &#123;<br>            loc = i;<br>            <span class="hljs-keyword">break</span>;<br>        &#125;<br>    <span class="hljs-keyword">for</span> (<span class="hljs-type">int</span> i = loc; i &lt; n; i++) &#123;<br>        SCAN_order.<span class="hljs-built_in">push</span>(t[i]);<br>        SCAN_num += <span class="hljs-built_in">abs</span>(t[i] - t[i<span class="hljs-number">-1</span>]);<br>    &#125;<br>   <span class="hljs-comment">// SCAN_num-= abs(t[loc] - t[loc - 1]);//初始位置没有移动</span><br>    SCAN_num += <span class="hljs-built_in">abs</span>(t[n<span class="hljs-number">-1</span>] - t[loc - <span class="hljs-number">1</span>]);<span class="hljs-comment">//转头回来</span><br>    <span class="hljs-keyword">for</span> (<span class="hljs-type">int</span> i = loc<span class="hljs-number">-1</span>; i &gt;= <span class="hljs-number">0</span>; i--) &#123;<br>        SCAN_order.<span class="hljs-built_in">push</span>(t[i]);<br>        SCAN_num += <span class="hljs-built_in">abs</span>(t[i] - t[i + <span class="hljs-number">1</span>]);<br>    &#125;<br><br>&#125;<br><span class="hljs-function"><span class="hljs-type">int</span> <span class="hljs-title">main</span><span class="hljs-params">()</span></span><br><span class="hljs-function"></span>&#123;<br>    <span class="hljs-built_in">C_FCFS</span>();        <br>    <span class="hljs-built_in">C_SSTF</span>();    <br>    <span class="hljs-built_in">C_SCAN</span>();<br><br>    cout &lt;&lt; <span class="hljs-string">&quot;FCFS平均&quot;</span> &lt;&lt; (<span class="hljs-type">double</span>)FCFS_num / n &lt;&lt; <span class="hljs-string">&quot;\t顺序:&quot;</span>;<br>    <span class="hljs-keyword">while</span> (FCFS_order.<span class="hljs-built_in">size</span>()) &#123;<br>        cout &lt;&lt; FCFS_order.<span class="hljs-built_in">front</span>() &lt;&lt; <span class="hljs-string">&quot; &quot;</span>;<br>        FCFS_order.<span class="hljs-built_in">pop</span>();<br>    &#125;<br>    cout &lt;&lt; <span class="hljs-string">&quot;\nSSTF平均&quot;</span> &lt;&lt; (<span class="hljs-type">double</span>)SSTF_num / n &lt;&lt; <span class="hljs-string">&quot;\t顺序:&quot;</span>;<br>    <span class="hljs-keyword">while</span> (SSTF_order.<span class="hljs-built_in">size</span>()) &#123;<br>        cout &lt;&lt; SSTF_order.<span class="hljs-built_in">front</span>() &lt;&lt; <span class="hljs-string">&quot; &quot;</span>;<br>        SSTF_order.<span class="hljs-built_in">pop</span>();<br>    &#125;<br>    cout &lt;&lt; <span class="hljs-string">&quot;\nSCAN平均&quot;</span> &lt;&lt; (<span class="hljs-type">double</span>)SCAN_num / n &lt;&lt; <span class="hljs-string">&quot;\t顺序:&quot;</span>;<br>    <span class="hljs-keyword">while</span> (SCAN_order.<span class="hljs-built_in">size</span>()) &#123;<br>        cout &lt;&lt; SCAN_order.<span class="hljs-built_in">front</span>() &lt;&lt; <span class="hljs-string">&quot; &quot;</span>;<br>        SCAN_order.<span class="hljs-built_in">pop</span>();<br>    &#125;<br><br>    <span class="hljs-keyword">return</span> <span class="hljs-number">0</span>;<br>&#125;<br><br><span class="hljs-comment">/*</span><br><span class="hljs-comment">先来先服务算法（FCFS）:按访问请求到达的先后次序服务。</span><br><span class="hljs-comment">最短寻道时间优先算法（SSTF）:优先选择距当前磁头最近的访问请求进行服务</span><br><span class="hljs-comment">扫描算法（电梯算法）（SCAN）:</span><br><span class="hljs-comment">    当有访问请求时，磁头按一个方向移动，在移动过程中对遇到的访问请求进行服务，</span><br><span class="hljs-comment">    然后判断该方向上是否还有访问请求，如果有则继续扫描；</span><br><span class="hljs-comment">    否则改变移动方向，并为经过的访问请求服务，如此反复。</span><br><span class="hljs-comment"></span><br><span class="hljs-comment">*/</span><br></code></pre></td></tr></table></figure>

<h2 id="运行结果"><a href="#运行结果" class="headerlink" title="运行结果"></a>运行结果</h2><p><img src="https://imgbed.cheney.cc/picgo/20210505225833777.png" srcset="/img/loading.gif" lazyload alt="在这里插入图片描述"></p>

            </div>
            <hr>
            <div>
              <div class="post-metas mb-3">
                
                  <div class="post-meta mr-3">
                    <i class="iconfont icon-category"></i>
                    
                      <a class="hover-with-bg" href="/categories/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F/">操作系统</a>
                    
                  </div>
                
                
                  <div class="post-meta">
                    <i class="iconfont icon-tags"></i>
                    
                      <a class="hover-with-bg" href="/tags/%E7%AE%97%E6%B3%95/">算法</a>
                    
                      <a class="hover-with-bg" href="/tags/C%E8%AF%AD%E8%A8%80/">C语言</a>
                    
                  </div>
                
              </div>
              
                <p class="note note-warning">
                  
                    本博客所有文章除特别声明外，均采用 <a target="_blank" href="https://creativecommons.org/licenses/by-sa/4.0/deed.zh" rel="nofollow noopener noopener">CC BY-SA 4.0 协议</a> ，转载请注明出处！
                  
                </p>
              
              
                <div class="post-prevnext">
                  <article class="post-prev col-6">
                    
                    
                      <a href="/2021/05/04/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F__%E5%A4%9A%E7%BA%A7%E9%98%9F%E5%88%97%E8%B0%83%E5%BA%A6%E5%92%8C%E5%A4%9A%E7%BA%A7%E5%8F%8D%E9%A6%88%E9%98%9F%E5%88%97%E8%B0%83%E5%BA%A6%E7%AE%97%E6%B3%95%E7%9A%84%E5%AE%9E%E7%8E%B0/">
                        <i class="iconfont icon-arrowleft"></i>
                        <span class="hidden-mobile">多级队列调度和多级反馈队列调度算法的实现</span>
                        <span class="visible-mobile">上一篇</span>
                      </a>
                    
                  </article>
                  <article class="post-next col-6">
                    
                    
                      <a href="/2021/05/02/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F__%E5%8A%A8%E6%80%81%E5%88%86%E5%8C%BA%E5%BC%8F%E5%86%85%E5%AD%98%E7%AE%A1%E7%90%86/">
                        <span class="hidden-mobile">动态分区式内存管理</span>
                        <span class="visible-mobile">下一篇</span>
                        <i class="iconfont icon-arrowright"></i>
                      </a>
                    
                  </article>
                </div>
              
            </div>

            
          </article>
        </div>
      </div>
    </div>
    
      <div class="d-none d-lg-block col-lg-2 toc-container" id="toc-ctn">
        <div id="toc">
  <p class="toc-header"><i class="iconfont icon-list"></i>&nbsp;目录</p>
  <div class="toc-body" id="toc-body"></div>
</div>

      </div>
    
  </div>
</div>

<!-- Custom -->


    

    
      <a id="scroll-top-button" aria-label="TOP" href="#" role="button">
        <i class="iconfont icon-arrowup" aria-hidden="true"></i>
      </a>
    

    
      <div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
     aria-hidden="true">
  <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header text-center">
        <h4 class="modal-title w-100 font-weight-bold">搜索</h4>
        <button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body mx-3">
        <div class="md-form mb-5">
          <input type="text" id="local-search-input" class="form-control validate">
          <label data-error="x" data-success="v"
                 for="local-search-input">关键词</label>
        </div>
        <div class="list-group" id="local-search-result"></div>
      </div>
    </div>
  </div>
</div>
    

    
  </main>

  <footer class="text-center mt-5 py-3">
  <div class="footer-content">
     <a href="https://hexo.io" target="_blank" rel="nofollow noopener"><span>Hexo</span></a> <i class="iconfont icon-love"></i> <a href="https://cheney822.gitee.io/" target="_blank" rel="nofollow noopener"><span>备用网址</span></a> 
  </div>
  

  
  <!-- 备案信息 -->
  <div class="beian">
    <span>
      <a href="http://beian.miit.gov.cn/" target="_blank" rel="nofollow noopener">
        皖ICP备2022002876号-1
      </a>
    </span>
    
  </div>


  
</footer>


  <!-- SCRIPTS -->
  
  <script  src="https://cdn.jsdelivr.net/npm/nprogress@0/nprogress.min.js" ></script>
  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/nprogress@0/nprogress.min.css" />

  <script>
    NProgress.configure({"showSpinner":false,"trickleSpeed":100})
    NProgress.start()
    window.addEventListener('load', function() {
      NProgress.done();
    })
  </script>


<script  src="https://cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js" ></script>
<script  src="https://cdn.jsdelivr.net/npm/bootstrap@4/dist/js/bootstrap.min.js" ></script>
<script  src="/js/events.js" ></script>
<script  src="/js/plugins.js" ></script>

<!-- Plugins -->


  <script  src="/js/local-search.js" ></script>



  
    <script  src="/js/img-lazyload.js" ></script>
  



  



  
    <script  src="https://cdn.jsdelivr.net/npm/tocbot@4/dist/tocbot.min.js" ></script>
  
  
    <script  src="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3/dist/jquery.fancybox.min.js" ></script>
  
  
    <script  src="https://cdn.jsdelivr.net/npm/anchor-js@4/anchor.min.js" ></script>
  
  
    <script defer src="https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js" ></script>
  






  <script  src="https://cdn.jsdelivr.net/npm/typed.js@2/lib/typed.min.js" ></script>
  <script>
    (function (window, document) {
      var typing = Fluid.plugins.typing;
      var title = document.getElementById('subtitle').title;
      
        typing(title);
      
    })(window, document);
  </script>















<!-- 主题的启动项 保持在最底部 -->
<script  src="/js/boot.js" ></script>


</body>
</html>
